-- this is a code snippet from the manage_dept_proj shown on pages 29 and 30. 
-- this code is not complete and it won't compile. Run the code file code_04_30_n.sql instead.

FUNCTION get_dept_project (p_dept_id NUMBER)
    RETURN typ_projectlist
  IS
    v_accounting_project typ_projectlist;
  BEGIN  -- this example uses a fetch from the database
     SELECT  projects INTO  v_accounting_project
       FROM  department WHERE dept_id = p_dept_id;
     RETURN v_accounting_project;
  END get_dept_project;
